# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=libblastrampoline
pkgver=5.8.0
pkgrel=1
pkgdesc='Using PLT trampolines to provide a BLAS and LAPACK demuxing library'
arch=(loong64 x86_64)
url='https://github.com/JuliaLinearAlgebra/libblastrampoline'
license=(MIT)
depends=(glibc)
source=(https://github.com/JuliaLinearAlgebra/libblastrampoline/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('aeceb01ebebdd1068a1147b636451c46c16d64f9e22694075abda4dddfffe13d')
options=(!lto)

build() {
  cd $pkgname-$pkgver/src
  make\
    COMPLEX_RETSTYLE_AUTODETECTION=0 \
    F2C_AUTODETECTION=0 \
    LBT_CFLAGS="$CFLAGS -fPIC -D_GNU_SOURCE" \
    LBT_LDFLAGS="-shared $LDFLAGS"
}

package() {
  cd $pkgname-$pkgver/src
  make F2C_AUTODETECTION=0 COMPLEX_RETSTYLE_AUTODETECTION=0 prefix="$pkgdir"/usr install
  install -Dm644 ../LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
